import {
    observable,
    action,

} from "mobx-miniprogram";

export const inspectionTaskIndexFilterStore = observable({
    listApi: null,
    // 记录tab 
    activedTab: 'assetType',
    //  单元目录
    directory: [],
    // 资产类型
    assetsType: [],
    //    使用科室
    useDept: [],
    //  巡检人
    inspectUserIdList: [],
    //  任务状态 1已超时 0待巡检
    state: [],
    setListApi: action(function (val) {
        this.listApi = val
    }),

    // 设置资产类型
    setAssetsType: action(function (val) {
        this.assetsType = val.map(item => item.value)
    }),
    // 设置单元目录
    setDirectory: action(function (val) {
        this.directory = val.map(item => item.value)
    }),
    setUseDept: action(function (val) {
        this.useDept = val.map(item => item.value)
    }),
    setState: action(function (e) {
        this.state = e.detail.value
    }),
    inspectionTaskIndexFilterStoreReset: action(function () {
        this.directory = ''
        this.inspectUserIdList = []
        this.state = ''
    }),
    setActivedTab: action(function (val) {
        this.activedTab = val
    })
})